Skip to content

reject CR/LF in FTP, POP3, NNTP and SMTP command senders#400

Open
dxbjavid wants to merge 1 commit into
apache:masterfrom
dxbjavid:reject-crlf-command-senders
Open

reject CR/LF in FTP, POP3, NNTP and SMTP command senders#400
dxbjavid wants to merge 1 commit into
apache:masterfrom
dxbjavid:reject-crlf-command-senders

Conversation

@dxbjavid
Copy link
Copy Markdown
Contributor

@dxbjavid dxbjavid commented Jun 4, 2026

the low-level sendCommand(command, args) in FTP, POP3, NNTP and SMTP appends the caller-supplied args straight onto the command line before the trailing CRLF, so an embedded CR or LF in something like an FTP path, a POP3 USER/PASS, an NNTP newsgroup or an SMTP reverse path smuggles a second command onto the control connection. i noticed it reading the sendCommand chain after the SimpleSMTPHeader work and it looks like the same CRLF-injection hole, just one layer lower. fix rejects CR/LF inside each command builder with IllegalArgumentException, which is where it belongs since the message is assembled there, and matches the existing header guards. tests cover each protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant